<?php
// +----------------------------------------------------------------------
// | Author: yaoyihong <510974211@qq.com>
// +----------------------------------------------------------------------

namespace app\api\model;

class GoodsComment extends ApiBase
{

    protected $auto = ['add_time',"ip"];

    protected function setAddTimeAttr($value)
    {
        return time();
    }
    public function getAddTimeAttr($value){
    	return date("Y-m-d",$value);
    }
    public function setIpAttr(){
    	return request()->ip();
    }
    public function setPhotosAttr($value){
    	$str=[];
    	foreach ($value as $k => $v) {
    		$str[]=$v['url'];
    	}
    	return $str?implode(",", $str):"";
    }
}